<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>销售单位管理</title>
    <#include "${ctx.getContextPath()}/css.jsp" parse=true encoding="utf-8">
</head>
<body>
<#include "${ctx.getContextPath()}/js.jsp" parse=true encoding="utf-8">
<div class="page">
    <header class="bar bar-nav">
        <a class="button button-link button-nav pull-left external " href="${ctx.getContextPath()}/company/companyList"
           data-transition='slide-out'>
            <span class="icon icon-left"></span>
            返回
        </a>
        <h1 class="title">${sysCompany.companyName!''}</h1>
    </header>
    <div class="content">
        <div class="card">
            <div class="card-header">${sysCompany.companyName!''}</div>
            <div class="card-content">
                <div class="card-content-inner">
                    <p class="color-gray">法人姓名：${sysCompany.corporation!''}</p>
                    <p class="color-gray">联系电话：${sysCompany.phonyNumber!''}</p>
                    <p class="color-gray">单位地址：${sysCompany.companyAddress!''}</p>
                    <p class="color-gray">操作时间: ${sysCompany.createTime?string('yyyy-MM-dd')}</p>
                </div>
            </div>
            <div class="card-footer no-border">
                <a href="${ctx.getContextPath()}/company/companyList"
                   class="link button button-round button-fill button-success external ">返回</a>
                <a href="${ctx.getContextPath()}/company/gotoAdd?companyId=${sysCompany.uuid}"
                   class="link button button-round button-fill external">修改</a>
                <a href="#" onclick="deleteCom('${sysCompany.uuid}')"
                   class="link button button-round button-fill button-danger external ">删除</a>
            </div>
        </div>
    </div>
</div>
<script>
    function deleteCom(uuid) {
        $.confirm('确定删除吗?', function () {
            $.ajax(
                {
                    type: "POST",//方法类型
                    dataType: "json",
                    url: "/company/delete",
                    data: {
                        uuid: uuid
                    },
                    success: function (result) {
                        var msg = result.message;
                        if (result.code == 200) {
                            location.href = "${ctx.getContextPath()}/company/companyList";
                        } else {
                            $.alert(msg);
                        }
                    },
                    error: function () {
                        alert("系统异常！");
                    }
                }
            );


        });
    }
</script>
</body>
</html>